using System;
using System.Windows.Forms;
using NUnit.Framework;

namespace ComponentTracer.Tests
{
    [TestFixture]
    public class UserControlTests
    {
        [Test]
        public void Methoden_Aufruf_ohne_Parameter_wird_getraced()
        {
            var traceOutput = "";
            var service = new MyUserControl();

            var tracedService = TracerProxy.Create<IMyUserControl>(service, s => { traceOutput += s; });
            tracedService.Do();

            Assert.That(traceOutput, Is.EqualTo("ComponentTracer.Tests.UserControlTests+MyUserControl.Do()\n"));
        }

        public interface IMyUserControl
        {
            void Do();
        }

        public class MyUserControl : UserControl, IMyUserControl
        {
            public void Do() {
            }
        }
    }
}